//
//  CYLoginHttpTool.h
//  CreditAddressBook
//
//  Created by Lee on 15/4/27.
//  Copyright (c) 2015年 Lee. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "CYHttpTool.h"
#import "CYUserData.h"
@class CYCompanyRegParam;

@interface CYLoginHttpTool : NSObject

+ (void)loginWithUserName:(NSString *)username andPassword:(NSString *)password success:(HttpRequestSuccess)success failure:(HttpRequestFailure)failure;

+ (void)regeditWithParams:(NSDictionary *)params success:(HttpRequestSuccess)success failure:(HttpRequestFailure)failure;

+ (void)sendSMSWithPhone:(NSString *)phone success:(HttpRequestSuccess)success failure:(HttpRequestFailure)failure;
+ (void)sendSMSWithUsername:(NSDictionary *)username success:(HttpRequestSuccess)success failure:(HttpRequestFailure)failure;

+ (void)checkUserNameWithUserName:(NSString *)userName success:(HttpRequestSuccess)success failure:(HttpRequestFailure)failure;

+ (void)findPasswordWithPhone:(NSString *)phone andPhoneCode:(NSString *)phoneCode success:(HttpRequestSuccess)success failure:(HttpRequestFailure)failure;

#pragma mark -
/**
 *  企业注册
 */
+ (void)regeditCompanyWithParams:(CYCompanyRegParam *)params success:(void(^)(NSString *message))success failure:(HttpRequestFailure1)failure;
/**
 *  验证租车企业是否已经存在
 */
+ (void)checkCarCompanyUserWithCompanyAccount:(NSString *)carCompanyAccount success:(void(^)())success failure:(HttpRequestFailure1)failure;
/**
 *  企业登陆
 */
+ (void)companyLoginWithUserName:(NSString *)username andPassword:(NSString *)password success:(void(^)(NSString *message))success failure:(HttpRequestFailure1)failure;

#pragma mark -
/**
 *  保存用户登录信息
 */
+ (BOOL)saveUserLoginInfo:(CYUser *)user;

/**
 *  保存用户信息
 */
+ (BOOL)updateUserData:(CYUser *)user;

/**
 *  获取用户信息
 */
+ (CYUserData *)userData;

/**
 *  清除用户信息
 */
+ (BOOL)isClearUserData;

/**
 *  退出登录清除用户信息
 */
+ (BOOL)logout;
/**
 *  退出登录并跳转到登陆页面
 */
+ (void)logoutWithController:(UIViewController *)con;
@end
